<template>
    <div style="text-align: center; margin: 20px;">
        <el-pagination background layout="total, prev, pager, next,jumper" :total="total" :page-size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange">
        </el-pagination>
    </div>

</template>

<script>
export default {
    name: 'MyPagination',
    props: {
        total: {
            type: Number,
            default: 100
        },
        pageSize: {
            type: Number,
            default: 10
        }
    },
    methods: {
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.$emit('pageChange', val)
        }
    },
}
</script>

<style>
</style>
